package com.leyou.auth.local;


import com.leyou.auth.dto.UserDetails;

public class UserContext {

    public final static ThreadLocal<UserDetails> tl = new ThreadLocal<>();
    public final static ThreadLocal<String> jwtTl = new ThreadLocal<>();

    public static UserDetails  getUser(){
       return tl.get();
    }

    public static void  setUser(UserDetails user){
        tl.set(user);
    }

    public static  void removeUser(){
        tl.remove();
    }

    public static void setJwt(String jwt) {
        jwtTl.set(jwt);
    }
    public static String  getJwt(){
        return jwtTl.get();
    }
    public static void   removeJwt() {
        jwtTl.remove();
    }
}
